<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>企业查询</title>
    <link rel="stylesheet" type="text/css" href="__STATIC__/pc/css/head.css">
	<link rel="stylesheet" type="text/css" href="__STATIC__/pc/css/bottom.css">
	<link rel="stylesheet" type="text/css" href="__STATIC__/pc/css/setdiv.css">
	<script type="text/javascript" src="__STATIC__/pc/js/index.js"></script>
	<script type="text/javascript" src="__STATIC__/pc/js/jquery-3.2.1.min.js"></script>
</head>

<style type="text/css">
    body{
        font-size: 12px;
        margin: 0;
        padding: 0;
    }
    .pic{
        text-align: center;
        height: 328px;
        overflow: hidden;
    }
    .pic img{
        height: 350px;
    }
    .lianjie{
        margin-left: 34px;
        font-size: 18px;
        color: #7B7B7B;
        margin-top: 14px;
    }
    .search{
        display:flex;
        -webkit-display:flex;
        justify-content: space-between;
        padding: 0 68px;
        font-size: 18px;
        margin-top: 40px;
    }
    .search select{
        width: 157px;
        height: 38px;
        line-height: 38px;
    }
    .pic3{
        width: 30px;
        position: relative;
        top: 5px;
        margin-right: 3px;
    }
    .searchbox{
        display:flex;
        -webkit-display:flex;
        justify-content: center;
    }
    .searchbox img{
        width: 31px;
        margin-top: 12px;
        margin-left: 12px;
    }
    .searchbox input{
        height: 50px;
        width: 800px;
        border-bottom-left-radius: 30px;
        border-top-left-radius: 30px;
        border:none;
        border-top: 1px solid #0EC0D5;
        border-bottom: 1px solid #0EC0D5;
        border-left: 1px solid #0EC0D5;
        outline-style: none;
        font-size: 20px;
        padding-left: 32px;
        padding-right: 32px;
    }
    .searchbox div{
        width: 52px;
        height: 52px;
        border:1px solid #0EC0D5;
        border-top-right-radius: 30px;
        border-bottom-right-radius: 30px;
        border-left: 0;
    }
    .eg{
        width: 930px;
        margin: 0 auto;
        font-size: 14px;
        color: #FF8610;
    }
    .eg div{
        margin-right: 30px;
        margin-top: 25px;
        display: inline-block;
    }
    .dilu{
        display:flex;
        -webkit-display:flex;
        justify-content: space-between;
        padding: 0 50px;
        margin-top: 30px;
    }
    table{
        font-size: 14px;
        margin-top: 40px;
        font-family: "微软雅黑";
    }
    thead tr{
        height: 63px;
        background: #ccc;
        font-size: 16px;
        font-weight: 600;
    }
    tbody tr{
        height: 50px;
    }
    .btn1{
        width: 92px;
        height: 33px;
        background: #FF8610;
        text-align: center;
        line-height: 33px;
        border-radius: 10px;
        color: #fff;
        font-size: 14px;
    }
    .btn2{
        width: 92px;
        height: 33px;
        background: #ccc;
        text-align: center;
        line-height: 33px;
        border-radius: 10px;
        color: #fff;
        font-size: 14px;
    }
    .btn3{
        width: 92px;
        height: 33px;
        background: #00B1D7;
        text-align: center;
        line-height: 33px;
        border-radius: 10px;
        color: #fff;
        font-size: 14px;
    }
    .line{
        width: 100%;
        height: 1px;
        background: #eee;
        margin-top: 80px;
        margin-bottom: 33px;
    }
    	display: flex;
		-wekbit-display:flex;
		justify-content: center;
		position: relative;
		top: -10px;
	}
	.xia_line{
		width: 110px;
		height: 4px;
		background-color: #00b1d7;
		border-radius: 2px;
	}
	.xia_dian{
		width: 36px;
		height: 36px;
		border-radius: 18px;
		background-color: #ffad01;
		position: relative;
		top: -16px;
		margin-left: 3px;
		margin-right: 3px;
	}
	.zhongjian{
		width: 70px !important;
		height: 70px;
		border-radius: 50%;
		border: 1px solid #eee;
		position: absolute;
		left: calc(50% - 35px);
		top: 1335px;
		background-color: #fff;
		z-index: 2
	}
	.zhongjian_dian{
		width: 10px;
		height: 10px;
		border-radius: 5px;
		background-color: #ffad01;
		margin-top: 30px;
		margin-left: 30px;
	}
	.xia1{
		margin-right: 100%;
	}
 
</style>
<body>
<div style="background: #00B1D7;color: #fff;">
    <include file="Public:nav" />
</div>
<div class="pic">
    <img src="__STATIC__/pc/img/company_select.jpg">
</div>
<include file="Public:boder" />




	<div class="bodycenter" >
	


<div class="lianjie">首页>搜索</div>
<form action="{:url('Company/index')}">
    <div class="searchbox">

        <input type="text" name="company_name" placeholder="输入企业名……" value="{$company_name?$company_name:'';}">
        <div onclick="project_submit()" class="searchbtn">
            <img src="__STATIC__/pc/img/search.png">
        </div>

    </div>
</form>
<div class="eg" style="position: relative">
        <volist name="hot_search" id="vo">
            <a href="{:url('company/index',array('company_name'=>$vo.search_name))}"><div style="color: #000">{$vo.search_name}</div></a>
        </volist>
        <div style="color: #7B7B7B;position: absolute;right: 0px;margin: 0px;top: 24px;">共有 <span style="color: #0EC0D5;" >{$company_count}</span>  条记录</div>
</div>
<div style="height: 30px;width: 100%;text-align: center;line-height: 20px;font-size: 20px;font-weight: 700;margin-top:20px">筛选结果</div>

		<!--
<div class="dilu">
    <div style="font-size: 18px;color: #7B7B7B;">筛选结果：</div>
</div> 
<div class="zixu">
		<div class="new-title1" style="margin-bottom: 0;margin-top: 26px;color: #5E5E5E;">筛选结果</div>
        	作者：offline
        	时间：2018-05-21
        	描述：
        	<div style="color: #cbeaf4;font-size: 24px;text-align: center;color: #d1d1e5;">NOTICE</div>
		<div class="xia" style="top: 20px;margin-bottom: 20px;">
			<div class="xia_line"></div>
			<div class="xia_dian"></div>
			<div class="xia_line"></div>
		</div>
	</div>
        -->
<!--
	作者：offline
	时间：2018-05-21
	描述：
	
-->
<table width="100%" cellspacing="0" cellpadding="0" style="margin-top:0px" class="msgtable">
    <!-- <thead>
    <tr>
         <td style="width:70%" align="center">筛选结果</td>
    </tr>
    </thead>
    
 
    -->
       <thead>
    <tr>
        <td style="width: 15%;" align="center">序号</td>
        <td style="width: 20%;" align="center">企业名称</td>
        <td style="width: 20%;" align="center">地址</td>
        <td style="width: 20%;" align="center">关注</td>
    </tr>
    </thead>
    <tbody>
    <tr style="height: 30px;"></tr>
    <volist name="company_result" id="vo">
        <tr>
            <td align="center" style="color:grey">{$vo.id}</td>
            <td align="center"><a href="javascript:void(0)" onclick="return_company(this)" a_href="{:url('company/company_condition_info')}" id="{$vo.id}" style="display:block;color:grey">{$vo.name}</a></td>
            <td align="center" style="color:grey">{$vo.path_tem}</td>
            <if condition="$vo.is_attention eq 0 || $vo.is_attention eq -1">
	            <td align="center">
	            	<a href="javascript:void(0)" style="display:block;" class="btn1" onclick="change_class(this)" <if condition="$vo.is_attention eq -1">status="1"<else />status="0"</if>company_id="{$vo.id}">
							+关注
					</a>
				</td>
			</if>
			<if condition="$vo.is_attention eq 1">
				<td align="center">
					<a href="javascript:void(0)" style="display:block;" class="btn3" onclick="change_class(this)" status="-1" company_id="{$vo.id}">
						取消关注
					</a>
				</td>
			</if>
        </tr>
    </volist>
    </tbody>
</table>


<div class="line"></div>
<div class="page" style="font-size: 15px;">
    {$page}
</div>

	</div>
<include file="Public:footer" />
</body>
<script src="__STATIC__/admin/js/jquery.js"></script>
<script type="text/javascript">
		//页面加载,调用js
$(document).ready(function () {
            pageLoad();   //页面加载，隔行变色
        });
 
//页面加载时，对Table表格移动鼠标行变色操作，通用方法
function pageLoad() {
 
    //table 中设置class属性[class= msgtable]
    $("table[class=msgtable]").each(function () {
        var _this = $(this);
        //设置偶数行和奇数行颜色
        _this.find("tr:even").css("background-color", "#f0f0f0");
        _this.find("tr:odd").css("background-color", "#f9f9f9");
 
        //鼠标移动隔行变色hover用法关键
        _this.find("tr:not(:first)").hover(function () {
            $(this).attr("bColor", $(this).css("background-color")).css("background-color", "#E0E0E0").css("cursor", "pointer");
        }, function () {
            $(this).css("background-color", $(this).attr("bColor"));
        });
 
    });
}
	
    function project_submit(){
        $('form').submit();
    }

    function change_class(obj){
    	var status = $(obj).attr('status');
    	var company_id = $(obj).attr('company_id');
    	var class_name = $(obj).attr('class');
    	var bool = false;

    	var formData = new FormData();
    	formData.append('status',status);
        formData.append('company_id',company_id);

    	$.ajax({
            url:"{:url('Company/follow')}",
            type:'POST',
            data:formData,
            async:false,
            processData:false,
            contentType:false,
            success:function(result){
            	if(result.code == 0){
            		layer.alert(result.msg);
            		bool = true;
            	}
            }

        });

        if(bool){
        	return false;
        }


    	$(obj).removeClass('btn1');
    	$(obj).removeClass('btn3');
    	//$(obj).attr('status','');

    	if(class_name == 'btn1'){
    		$(obj).attr("class","btn3");
    		$(obj).text("取消关注");
    		$(obj).attr('status','-1');
    	}else{
    		$(obj).attr("class","btn1");
    		$(obj).attr('status','1');
    		$(obj).text("+关注");
    	}
    	
    
	}

    function return_company(obj){
        var a_href = $(obj).attr('a_href');
        var id = $(obj).attr('id');

        var formData = new FormData();
        formData.append('company_id',id);

        $.ajax({
            url:a_href,
            type:'POST',
            data:formData,
            async:false,
            processData:false,
            contentType:false,
            success:function(result){
                if(result.code == 0){
                    layer.alert(result.msg);
                    return false;
                }

                location.href=result.url;
            }

        });
    }
</script>

</html>